/*
 * ADConverter.h
 *
 *  Created on: 13.01.2013
 *      Author: Edward
 */

#ifndef ADCONVERTER_H_
#define ADCONVERTER_H_

#include "stdint.h"

#define buffersize 			1
//#define MAXVOLTAGE			11.2
#define MAXVOLTAGE			11.66
#define MINVOLTAGE			9
#define ADC_RESOLUTION		4095.

class ADConverter {
public:
	ADConverter();
	virtual ~ADConverter();
	float getBatteryVoltage();
	float getBatteryPercent();
private:
	void initADC();
	uint16_t getBatteryRaw();
	int cnt;
	int meanRaw;
	uint16_t rawbuffer[buffersize];
};

#endif /* ADCONVERTER_H_ */
